package org.atlantis.evnlib.execution.rejecter;

import java.util.concurrent.BlockingQueue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志策略。当任务被拒绝时仅输出警告日志。然后直接拒绝该任务。
 * 
 * @author <a href="mailto:seenoevil.cn@gmail.com">李曦</a><br/>
 *         Created at: 2011-7-13 上午10:37:09
 */
public class LoggerRejectedTaskHandler implements RejectedTaskHandler {

	private static final Logger log = LoggerFactory.getLogger(LoggerRejectedTaskHandler.class);

	@Override
	public boolean rejectedTask(String name, Runnable task, BlockingQueue<Runnable> taskQueue) {
		log.warn("No more threads for Event<{}>.", name);
		return false;
	}
}
